package com.sv.dao;

import com.sv.base.BaseDao;
import com.sv.model.SdContentExt;
import com.sv.model.SdContentExtCriteria;
import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowire;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.stereotype.Repository;

@Repository
@Configurable(autowire=Autowire.BY_TYPE)
public class SdContentExtDAOImpl extends BaseDao implements SdContentExtDAO {
//    /**
//     * This field was generated by Apache iBATIS ibator.
//     * This field corresponds to the database table sd_content_ext
//     *
//     * @ibatorgenerated Tue Mar 27 09:43:01 CST 2012
//     */
//    private SqlMapClient sqlMapClient;
//
//    /**
//     * This method was generated by Apache iBATIS ibator.
//     * This method corresponds to the database table sd_content_ext
//     *
//     * @ibatorgenerated Tue Mar 27 09:43:01 CST 2012
//     */
//    public SdContentExtDAOImpl(SqlMapClient sqlMapClient) {
//        super();
//        this.sqlMapClient = sqlMapClient;
//    }
//
//    /**
//     * This method was generated by Apache iBATIS ibator.
//     * This method corresponds to the database table sd_content_ext
//     *
//     * @ibatorgenerated Tue Mar 27 09:43:01 CST 2012
//     */
   
    public int countByExample(SdContentExtCriteria example) throws SQLException {
        Integer count = (Integer)  getSqlMapClient().queryForObject("sd_content_ext.ibatorgenerated_countByExample", example);
        return count.intValue();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table sd_content_ext
     *
     * @ibatorgenerated Tue Mar 27 09:43:01 CST 2012
     */
    public int deleteByExample(SdContentExtCriteria example) throws SQLException {
        int rows =  getSqlMapClient().delete("sd_content_ext.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table sd_content_ext
     *
     * @ibatorgenerated Tue Mar 27 09:43:01 CST 2012
     */
    public int deleteByPrimaryKey(Integer contentId) throws SQLException {
        SdContentExt key = new SdContentExt();
        key.setContentId(contentId);
        int rows =  getSqlMapClient().delete("sd_content_ext.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table sd_content_ext
     *
     * @ibatorgenerated Tue Mar 27 09:43:01 CST 2012
     */
    public void insert(SdContentExt record) throws SQLException {
         getSqlMapClient().insert("sd_content_ext.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table sd_content_ext
     *
     * @ibatorgenerated Tue Mar 27 09:43:01 CST 2012
     */
    public void insertSelective(SdContentExt record) throws SQLException {
         getSqlMapClient().insert("sd_content_ext.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table sd_content_ext
     *
     * @ibatorgenerated Tue Mar 27 09:43:01 CST 2012
     */
    public List selectByExample(SdContentExtCriteria example) throws SQLException {
        List list =  getSqlMapClient().queryForList("sd_content_ext.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table sd_content_ext
     *
     * @ibatorgenerated Tue Mar 27 09:43:01 CST 2012
     */
    public SdContentExt selectByPrimaryKey(Integer contentId) throws SQLException {
        SdContentExt key = new SdContentExt();
        key.setContentId(contentId);
        SdContentExt record = (SdContentExt)  getSqlMapClient().queryForObject("sd_content_ext.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table sd_content_ext
     *
     * @ibatorgenerated Tue Mar 27 09:43:01 CST 2012
     */
    public int updateByExampleSelective(SdContentExt record, SdContentExtCriteria example) throws SQLException {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows =  getSqlMapClient().update("sd_content_ext.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table sd_content_ext
     *
     * @ibatorgenerated Tue Mar 27 09:43:01 CST 2012
     */
    public int updateByExample(SdContentExt record, SdContentExtCriteria example) throws SQLException {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows =  getSqlMapClient().update("sd_content_ext.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table sd_content_ext
     *
     * @ibatorgenerated Tue Mar 27 09:43:01 CST 2012
     */
    public int updateByPrimaryKeySelective(SdContentExt record) throws SQLException {
        int rows =  getSqlMapClient().update("sd_content_ext.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table sd_content_ext
     *
     * @ibatorgenerated Tue Mar 27 09:43:01 CST 2012
     */
    public int updateByPrimaryKey(SdContentExt record) throws SQLException {
        int rows =  getSqlMapClient().update("sd_content_ext.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table sd_content_ext
     *
     * @ibatorgenerated Tue Mar 27 09:43:01 CST 2012
     */
    private static class UpdateByExampleParms extends SdContentExtCriteria {
        private Object record;

        public UpdateByExampleParms(Object record, SdContentExtCriteria example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}